using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class FakeLines 
{

    public List<Rect> oldLines;
    public List<Rect> newLines;
    System.Random rnd = new System.Random();
    

    public FakeLines()
    {
        oldLines = new List<Rect>();
        newLines = new List<Rect>();

        

        Rect temp = new Rect();
        temp.x = rnd.Next(5, Screen.width / 2);
        temp.y = rnd.Next(5, Screen.height / 2);
        if (rnd.Next(0, 20) % 2 == 0)
        {
            
            temp.width = rnd.Next(10, Screen.width / 2 - 5);
            temp.height = 1;
        }
        else
        {
            temp.width = 1;
            temp.height = rnd.Next(10, Screen.height / 2 - 5);
        }
        newLines.Add(temp);
    }

    public void Split()
    {
        oldLines.AddRange(newLines);
        newLines = new List<Rect>();
        for (int i = 0; i < oldLines.Count * 2; i++)
        {
            Rect temp = new Rect();
            temp.x = rnd.Next(5, Screen.width / 2);
            temp.y = rnd.Next(5, Screen.height / 2);
            if (rnd.Next(0, 20) % 2 == 0)
            {
                temp.width = rnd.Next(10, Screen.width / 2 - 5);
                temp.height = 1;
            }
            else
            {
                temp.width = 1;
                temp.height = rnd.Next(10, Screen.height / 2 - 5);
            }
            newLines.Add(temp);
        }
    }
}




